import resources.Constants;

/* [start] 	initializes gui variables */
String _info = bundle.getProperty("registnet.module.student_records.macro.info");
 
String _actions = bundle.getProperty("registnet.module.student_records.macro.info.form.actions");
String _export = bundle.getProperty("registnet.module.student_records.macro.info.form.actions.export");
String _print = bundle.getProperty("registnet.module.student_records.macro.info.form.actions.print");

String _default_photo = bundle.getProperty("registnet.module.student_records.macro.info.form.default_photo");
String _student_number = bundle.getProperty("registnet.module.student_records.macro.info.form.student_number");
String _first_name = bundle.getProperty("registnet.module.student_records.macro.info.form.first_name");
String _middle_name = bundle.getProperty("registnet.module.student_records.macro.info.form.middle_name");
String _last_name = bundle.getProperty("registnet.module.student_records.macro.info.form.last_name");
String _sex = bundle.getProperty("registnet.module.student_records.macro.info.form.sex");
String _citizenship = bundle.getProperty("registnet.module.student_records.macro.info.form.citizenship");
String _degree_course = bundle.getProperty("registnet.module.student_records.macro.info.form.degree_course");
String _curriculum = bundle.getProperty("registnet.module.student_records.macro.info.form.curriculum");
String _birth_date = bundle.getProperty("registnet.module.student_records.macro.info.form.birth_date");
String _signature = bundle.getProperty("registnet.module.student_records.macro.info.form.signature");
String _civil_status = bundle.getProperty("registnet.module.student_records.macro.info.form.civil_status");
String _college_address = bundle.getProperty("registnet.module.student_records.macro.info.form.college_address");
String _residential_address = bundle.getProperty("registnet.module.student_records.macro.info.form.residential_address");
String _zip_code = bundle.getProperty("registnet.module.student_records.macro.info.form.zip_code");
String _country = bundle.getProperty("registnet.module.student_records.macro.info.form.country");
String _telephone_number = bundle.getProperty("registnet.module.student_records.macro.info.form.telephone_number");
String _cellphone_number = bundle.getProperty("registnet.module.student_records.macro.info.form.cellphone_number");
String _email = bundle.getProperty("registnet.module.student_records.macro.info.form.email");
String _father = bundle.getProperty("registnet.module.student_records.macro.info.form.father");
String _mother = bundle.getProperty("registnet.module.student_records.macro.info.form.mother");
String _guardian = bundle.getProperty("registnet.module.student_records.macro.info.form.guardian");
String _guardian_name = bundle.getProperty("registnet.module.student_records.macro.info.form.guardian_name");
String _guardian_contact = bundle.getProperty("registnet.module.student_records.macro.info.form.guardian_contact");
String _guardian_address = bundle.getProperty("registnet.module.student_records.macro.info.form.guardian_address");
String _guardian_relationship = bundle.getProperty("registnet.module.student_records.macro.info.form.guardian_relationship");
String _guardian_email = bundle.getProperty("registnet.module.student_records.macro.info.form.guardian_email");
String _high_school = bundle.getProperty("registnet.module.student_records.macro.info.form.high_school");
String _high_school_name = bundle.getProperty("registnet.module.student_records.macro.info.form.high_school_name");
String _high_school_grade = bundle.getProperty("registnet.module.student_records.macro.info.form.high_school_grade");
String _miscellaneous = bundle.getProperty("registnet.module.student_records.macro.info.form.miscellaneous");
String _is_rgep = bundle.getProperty("registnet.module.student_records.macro.info.form.is_rgep");
String _stfap_bracket = bundle.getProperty("registnet.module.student_records.macro.info.form.stfap_bracket");
String _adviser = bundle.getProperty("registnet.module.student_records.macro.info.form.adviser");
/* [end] */



/* [start]	initializes the contetns of the form */
void initialize(){
	student_number_l.value = DAOStudent.getStudentNumber();
	first_name_l.value = DAOStudent.getFirstName();
	middle_name_l.value = DAOStudent.getMiddleName();
	last_name_l.value = DAOStudent.getLastName();
	sex_l.value = Constants.MAP_SEX_KEY.get(DAOStudent.getSex());
	citizenship_l.value = Constants.MAP_CITIZENSHIP_KEY.get(DAOStudent.getCitizenship());
	degree_l.value = DAOStudent.getCurriculum().getDegreeCourse().getDegreeCode();
	curri_l.value = DAOStudent.getCurriculum().getCurriculumCode();

	try{
		if (DAOStudent.getBirthDate() == null || DAOStudent.getBirthDate().length() == 0){
			birth_date_l.value = "Not Available";
			birth_date_l.setStyle("font-style: italic;");		
		}
		else{
			birth_date_l.value = DAOStudent.getBirthDate();
			birth_date_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getSignature() == null){
			signature_i.detach();
			signature_l.value = "Not Available";
			signature_l.setStyle("font-style: italic;");
		}
		else{
			signature_i.setContent(new org.zkoss.image.AImage("signature: " + DAOStudent.getStudentNumber(), DAOStudent.getSignature()));
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getPhoto() == null){
			photo_i.setContent(new org.zkoss.image.AImage(new java.net.URL(_default_photo)));
		}
		else{
			photo_i.setContent(new org.zkoss.image.AImage("photo: " + DAOStudent.getStudentNumber(), DAOStudent.getPhoto()));
		}
	}catch(Exception e){}

	try{
		civil_status_l.value = Constants.CIVIL_STATUS[DAOStudent.getCivilStatus() - 1];
	}catch(Exception e){}

	try{
		if (DAOStudent.getCollegeAddress() == null || DAOStudent.getCollegeAddress().equals("")){
			college_add_l.value = "Not Available";
			college_add_l.setStyle("font-style: italic;");		
		}
		else{
			college_add_l.value = DAOStudent.getCollegeAddress();
			college_add_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getResidentialAddress() == null || DAOStudent.getResidentialAddress().equals("")){
			residential_add_l.value = "Not Available";
			residential_add_l.setStyle("font-style: italic;");		
		}
		else{
			residential_add_l.value = DAOStudent.getResidentialAddress();
			residential_add_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getZipcode() == null || DAOStudent.getZipcode().toString().equals("0")){
			zip_code_l.value = "Not Available";
			zip_code_l.setStyle("font-style: italic;");
		}
		else{
			zip_code_l.value = DAOStudent.getZipcode().toString();
			zip_code_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){  }

	try{
		if (DAOStudent.getCountry() == null || DAOStudent.getCountry().length() == 0){
			country_l.value = "Not Available";
			country_l.setStyle("font-style: italic;");
		}
		else{
			country_l.value = DAOStudent.getCountry();
			country_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getTelephoneNumber() == null || DAOStudent.getTelephoneNumber().length() == 0){
			telephone_number_l.value = "Not Available";
			telephone_number_l.setStyle("font-style: italic;");
		}
		else{
			telephone_number_l.value = DAOStudent.getTelephoneNumber();
			telephone_number_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getCellphoneNumber() == null || DAOStudent.getCellphoneNumber().length() == 0){
			cellphone_number_l.value = "Not Available";
			cellphone_number_l.setStyle("font-style: italic;");
		}
		else{
			cellphone_number_l.value = DAOStudent.getCellphoneNumber();
			cellphone_number_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getEmail() == null || DAOStudent.getEmail().length() == 0){
			email_l.value = "Not Available";
			email_l.setStyle("font-style: italic;");
		}
		else{
			email_l.value = DAOStudent.getEmail();
			email_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getFather() == null || DAOStudent.getFather().toString().equals("")){
			father_l.value = "Not Available";
			father_l.setStyle("font-style: italic;");
		}
		else{
			father_l.value = DAOStudent.getFather();
			father_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getMother() == null || DAOStudent.getMother().toString().equals("")){
			mother_l.value = "Not Available";
			mother_l.setStyle("font-style: italic;");
		}
		else{
			mother_l.value = DAOStudent.getMother();
			mother_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getGuardian() == null || DAOStudent.getGuardian().toString().equals("")){
			guardian_l.value = "Not Available";
			guardian_l.setStyle("font-style: italic;");
		}
		else{
			guardian_l.value = DAOStudent.getGuardian();
			guardian_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getGuardianContactNumber() == null || DAOStudent.getGuardianContactNumber().length() == 0){
			g_contact_number_l.value = "Not Available";
			g_contact_number_l.setStyle("font-style: italic;");
		}
		else{
			g_contact_number_l.value = DAOStudent.getGuardianContactNumber();
			g_contact_number_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getGuardianAddress() == null || DAOStudent.getGuardianAddress().length() == 0){
			g_add_l.value = "Not Available";
			g_add_l.setStyle("font-style: italic;");
		}
		else{
			g_add_l.value = DAOStudent.getGuardianAddress();
			g_add_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getGuardianRelation() == null || DAOStudent.getGuardianRelation().length() == 0){
			g_relation_l.value = "Not Available";
			g_relation_l.setStyle("font-style: italic;");
		}
		else{
			g_relation_l.value = DAOStudent.getGuardianRelation();
			g_relation_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getGuardianEmail() == null || DAOStudent.getGuardianEmail().length() == 0){
			g_email_l.value = "Not Available";
			g_email_l.setStyle("font-style: italic;");
		}
		else{
			g_email_l.value = DAOStudent.getGuardianEmail();
			g_email_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getHighSchool() == null || DAOStudent.getHighSchool().equals("")){
			high_school_l.value = "Not Available";
			high_school_l.setStyle("font-style: italic;");
		}
		else{
			high_school_l.value = DAOStudent.getHighSchool();
			high_school_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		if (DAOStudent.getHighSchoolGrade() == null || DAOStudent.getHighSchoolGrade().toString().equals("0.0")){
			high_school_grade_l.value = "Not Available";
			high_school_grade_l.setStyle("font-style: italic;");
		}
		else{
			high_school_grade_l.value = DAOStudent.getHighSchoolGrade().toString();
			high_school_grade_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}

	try{
		is_rgep_l.value = Constants.MAP_ANSWER_VALUE.get(DAOStudent.getIsRGEP());
	}catch(Exception e){}

	try{
		stfap_bracket_l.value = Constants.STFAP_BRACKET[DAOStudent.getSTFAPBracket() - 1];
	}catch(Exception e){}

	try{
		if (DAOStudent.getAdviser() == null || DAOStudent.getAdviser().length() == 0){
			adviser_l.value = "Not Available";
			adviser_l.setStyle("font-style: italic;");
		}
		else{
			adviser_l.value = DAOStudent.getAdviser();
			adviser_l.setStyle("font-weight: bold;");
		}
	}catch(Exception e){}
}
/* [end] */